package com.open.capacity.user.service;

import com.open.capacity.common.model.Title;
import com.open.capacity.common.web.PageResult;
import com.open.capacity.common.web.Result;

import java.util.Map;

/**
 * 称号服务层
 * @author liutao
 * @date 2021-02-01 16:51
 */
public interface TitleService {
    /**
     * 模糊查询称号
     * @param params
     * @return
     */
    PageResult<Title> getSelectTitles(Map<String, Object> params);

    /**
     * 添加称号
     * @param title
     * @return
     */
    Result addTitle(Title title);

    /**
     * 修改称号
     * @param title
     * @return
     */
    Result updateTitle(Title title);

    /**
     * 删除称号
     * @param titlid
     * @return
     */
    Result delTitle(int titlid);

    /**
     * 查询自己获得的称号
     * @param params
     * @return
     */
    PageResult getTitleByUserId(Map<String, Object> params);

    /**
     * 更新某个教练的称号
     * @param userId
     * @param points
     * @return
     */
    Result updateTitleOfCoachByUserId(Long userId, Double points);

    Result getRuleByTypeAndRoleId(Integer typeId,Integer roleId);

    Result updateTitleOfMasterByUserId(Long userId, Double points);

    Result updateTitleOfStudentByUserId(Long userId, Double points);

    Result updateTitleOfRoleCodeByUserId(Long userId, Double points, String roleCode);

    Result updateTitleByUserIdAndPoints(Long userId, Double points, String typeCode);
}
